package com.msmall.community.play.cases.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.msmall.base.model.BaseObject;

/**
 * CASE实体
 * @author zhzy
 *
 */
@Entity
@Table(name="play_cases")
public class Cases extends BaseObject implements Serializable{

	private static final long serialVersionUID = 6276011403633487855L;

	@Id
	@Column(name="cases_id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long casesId;

	@Column(name="cases_name")
	private String casesName;
	
	/**
	 * 1可用 -1 不可用
	 */
	@Column(name="enabled")
	private Short enabled;
	
	@Column(name="description")
	private String description;
	
	/**
	 * 给后台审核的详细说明
	 */
	@Column(name="manifest")
	private String manifest;
	
	/**
	 * 是否审核通过 3通过 4不通过 1未审核 refer to ConstantDB.class
	 */
	@Column(name="audit")
	private Short audit;
	
	
	/**
	 * 完成后的奖励积分
	 */
	@Column(name="score")
	private Integer score;
	
	/**
	 * 一共有多少用户正在玩/已经玩过 此游戏
	 */
	@Column(name="total")
	private Integer total;
	
	/**
	 * 此游戏一共可以给多少用户玩， 例如一共游戏只能给前10个人玩 CASES_LIMITS_UNLIMIT
	 */
	@Column(name="limits")
	private Integer limits;
	/**
	 * 创建者
	 */
	@Column(name="creator")
	private Long creator;
	
	@Column(name="modify_time")
	@Temporal(TemporalType.TIMESTAMP)
	private Date modifyTime;
	
	@OneToMany(cascade = {CascadeType.PERSIST,CascadeType.MERGE},fetch=FetchType.LAZY, mappedBy="cases")
	private Set<UserCases> caseses;
	
	@OneToMany(cascade = {CascadeType.PERSIST,CascadeType.MERGE},fetch=FetchType.LAZY, mappedBy="cases")
	private Set<Scenario> scenarios;
	
	public Long getCasesId() {
		return casesId;
	}

	public void setCasesId(Long casesId) {
		this.casesId = casesId;
	}

	public Short getEnabled() {
		return enabled;
	}

	public void setEnabled(Short enabled) {
		this.enabled = enabled;
	}

	public String getCasesName() {
		return casesName;
	}

	public void setCasesName(String casesName) {
		this.casesName = casesName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Short getAudit() {
		return audit;
	}

	public void setAudit(Short audit) {
		this.audit = audit;
	}

	public Long getCreator() {
		return creator;
	}

	public void setCreator(Long creator) {
		this.creator = creator;
	}

	public Integer getScore() {
		return score;
	}

	public void setScore(Integer score) {
		this.score = score;
	}

	public String getManifest() {
		return manifest;
	}

	public void setManifest(String manifest) {
		this.manifest = manifest;
	}

	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	public Integer getLimits() {
		return limits;
	}

	public void setLimits(Integer limits) {
		this.limits = limits;
	}

	public Set<UserCases> getCaseses() {
		return caseses;
	}

	public void setCaseses(Set<UserCases> caseses) {
		this.caseses = caseses;
	}

	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public Set<Scenario> getScenarios() {
		return scenarios;
	}

	public void setScenarios(Set<Scenario> scenarios) {
		this.scenarios = scenarios;
	}

	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

}